package com.example.helloword.util;

import java.io.FileInputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;

public class SocketClient {

	public static void main(String[] args) {

		try {
			Socket socket = new Socket("127.0.0.1", 8888);
			InputStream inputStream = new FileInputStream("d://important.txt");
			OutputStream outputStream = socket.getOutputStream();
			byte buffer[] = new byte[1024];
			int temp = -1;
			while ((temp = inputStream.read(buffer)) != -1) {

				outputStream.write(buffer, 0, temp);
			}
			outputStream.flush();
		} catch (Exception e) {
			
		}
	}
}
